package com.zshy.base.core.properties;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 应用名称配置
 *
 * @author zhouhengzhe
 * @version 1.0
 * @date 2024/1/30 16:35
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ConfigurationProperties(prefix = "spring")
@Component
public class SpringProperties {

    private Application application;

    private Profile profiles;



    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class Application {
        /**
         * 应用名称
         */
        @Builder.Default
        private String name="UNKNOWN";
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class Profile {
        /**
         * 当前环境
         */
        private String active;
    }
}
